package com.jtjrenren.android.taxi.passenger.core.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jtjrenren.android.taxi.passenger.R;
import com.jtjrenren.android.taxi.passenger.bean.api.ApiRechargList;
import com.jtjrenren.android.taxi.passenger.base.BaseRcyAdapter;

/**
 * Created by Administrator on 2016/1/28.
 */
public class ChargeHistoryAdapter extends BaseRcyAdapter<ApiRechargList.RechargeListEntity> {

    public ChargeHistoryAdapter(Context context) {
        super(context);
    }

    @Override
    public RecyclerView.ViewHolder getItemViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.item_recharge_history, parent, false);
        return new ChargeItemViewHolder(view);
    }

    @Override
    public void onBindItemViewHolder(RecyclerView.ViewHolder holder, int position) {
        ApiRechargList.RechargeListEntity info=list.get(position);
        ChargeItemViewHolder itemViewHolder= (ChargeItemViewHolder) holder;
        itemViewHolder.tv_money.setText(info.getTradeFair());
        itemViewHolder.tv_date.setText(info.getTradeTime());
    }

    public class ChargeItemViewHolder extends RecyclerView.ViewHolder {
        TextView tv_money, tv_date;

        public ChargeItemViewHolder(View itemView) {
            super(itemView);

            tv_money = (TextView) itemView.findViewById(R.id.item_recharge_money);
            tv_date = (TextView) itemView.findViewById(R.id.item_recharge_date);
        }
    }
}
